#!/bin/bash

URL="https://home.meishichina.com/recipe/zaocan/"
curl -o info.html $URL
grep "红烧" info.html > all_about_hongshao.txt
awk -F '>' '{print $2}' all_about_hongshao.txt | awk -F '<' '{print $1}' > hongshao_name.txt
awk -F ' ' '{print $3}' all_about_hongshao.txt | awk -F '"' '{print $2}' > hongshao_addr.txt

for line in $(cat hongshao_addr.txt)
do 
tmp_addr=$line
curl $tmp_addr > content.html
grep "meta name=\"description\" content=" content.html > new_content.txt
awk -F '"' '{print $4}' new_content.txt >> hongshao.txt
done
exec 1<"hongshao_name.txt"
exec 2<"hongshao.txt"

echo  "红烧菜简介" >> zuofa_of_hongshao.txt
echo >> zuofa_of_hongshao.txt
echo >> zuofa_of_hongshao.txt
while read line1<&1 && read line2<&2
do
echo $line1 >> zuofa_of_hongshao.txt
echo >> zuofa_of_hongshao.txt
echo $line2 >> zuofa_of_hongshao.txt
echo >> zuofa_of_hongshao.txt
echo >> zuofa_of_hongshao.txt
done

rm hongshao_name.txt, hongshao_addr.txt, content.html, new_content.txt, hongshao.txt, info.html
